<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <script>
        /*2、构造函数的方式创建对象*/
        function Animal() {
            this.name = 'kitty';
            this.age = 23;
            this.run = function () {
                console.log(this.name + '正在跑步');
            }
        }
        var cat = new Animal();
        cat.run();
    </script>
</body>
</html>